﻿@model mBlog.Admin.ViewModels.AddPostViewModel

@{
    ViewBag.Title = "Add a New Post";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<h2>AddPost</h2>
<!-- markItUp! toolbar settings -->
<script type="text/javascript" src="@Url.Content("~/Content/markitup/sets/default/set.js")"></script>
<!-- markItUp! skin -->
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/markitup/skins/markitup/style.css")" />
<!--  markItUp! toolbar skin -->
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/markitup/sets/default/style.css")" />

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Post</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostInput.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.UrlName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostInput.UrlName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.CategoryUrlName)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.PostInput.CategoryUrlName, new SelectList(Model.Categories, "UrlName", "Name"), new { id = "categoryUrlName", name = "categoryUrlName" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.Excerpt)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.PostInput.Excerpt)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.Content)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.PostInput.Content)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.PostedTime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostInput.PostedTime)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.IsPublished)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostInput.IsPublished)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostInput.PublishedTime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PostInput.PublishedTime)
        </div>
        <div class="edit-label">
            @Html.LabelFor(model => model.PostInput.Tags)
        </div>
        <div class="edit-field">
            @Html.EditorFor(model => model.PostInput.Tags)
        </div>
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

<!-- markItUp! -->
<script type="text/javascript" src="@Url.Content("~/Content/markitup/jquery.markitup.js")"></script>
<script type="text/javascript">
    $('textarea').markItUp(mySettings);
</script>
